<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

//前台路由配置

// //使用中间件过滤session
 Route::group(['middleware'=>'logins'],function(){
 	//跳转到前台主页
 	Route::get('/home/index',function(){
 		return view('home.index');
 	 });
	//前台个人资料的路由
  	Route::get('/home/user/userdata/','home\UserController@cxzl');
  	//前台跳转首页路由
  	Route::get('/home/tzsy/','home\UserController@tzsy');
  	
});
//前台登录的路由
Route::get('/',function(){
return view('home.login.login');
});

//前台用户收藏夹
Route::controller('/home/scxx','home\CollectController');

//前台用户话题详情表
Route::controller('/home/lbxq','home\CollectController');

//前台用户管理路由
Route::controller('/home/user','home\UserController');

//前台问题路由
Route::controller('/home/index','home\IssueController');
//前台话题路由
Route::controller('/home/topic/topic','home\TopicController');
//前台话题路由
Route::get('home/topic/topic','home\TopicController@usertoc');
// 回答详情路由
Route::controller('/home/answerIn','home\AnswerInController');
//前台专栏路由
Route::controller('/home/zhuanlan','home\ZhuanlanController');
//写文章
Route::controller('/home/write','home\WriteController');
// 回答路由
Route::controller('/home/answer','home\AnswerController');
//后台话题管理
Route::controller('/admin/topic','admin\TopicController');
//后台问题管理
Route::controller('/admin/issue','admin\IssueController');

//测试路由
Route::get('/ahaha','PublicController@pic');

//后台路由配置
//后台登陆页
Route::get('/admin/login',function(){
	return view('admin.login');
});
//中间件(后台)
Route::group(['middleware'=>'login'],function(){

	//后台主页路由
	Route::get('/admin',function(){
		return view('admin.index');
	});
	//后台添加页面路由
	Route::get('admin/user/add',function(){
		return view('admin.user.add');
	});
	

});

//后台主页路由
/*
Route::get('/admin',function(){
	return view('admin.index');
});
*/
//后台添加页面路由
Route::get('admin/user/add',function(){
	return view('admin.user/add');
});
//后台用户管理
Route::controller('/admin/user','admin\UserController');
//用户收藏夹
Route::controller('/admin/collect','admin\CollectController');
//后台专栏
Route::controller('/admin/zhuanlan','admin\ZhuanlanController');
//后台文章
Route::controller('/admin/article','admin\ArticleController');
// 后台回复管理
Route::controller('/admin/answer','admin\AnswerController');
// 评论管理
Route::controller('/admin/comment','admin\CommentController');




